﻿@{
    Layout = "~/Views/Shared/_Index.cshtml";
}

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            岗位编码：<input type="text" name="postCode" />
                        </li>
                        <li>
                            岗位名称：<input type="text" name="postName" />
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:post:add">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:post:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:post:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        var options = {
            url: "/OrganizationManage/Position/GetPageListJson",
            createUrl:  "/OrganizationManage/Position/PositionForm",
            updateUrl:  "/OrganizationManage/Position/PositionForm",
            removeUrl:  "/OrganizationManage/Position/DeleteFormJson",
            exportUrl:  "",
            sortName: "positionSort",
            modalName: "岗位",
            columns: [
                { checkbox: true, visible: true },
                { field: 'id', title: 'id', visible: false },
                { field: 'positionName', title: '职位名称', width: "20%", sortable: true },
                { field: 'positionSort', title: '显示顺序', width: "15%", sortable: true },
                { field: 'baseModifyTime', title: '创建时间',width: "15%", sortable: true }
            ],
            onClickRow: function (row, element) {
                element[0].firstElementChild.firstElementChild.click();
            }
        };
        $.table.init(options);
    });
   
</script>